package com.shop.domain.article;

import java.util.Date;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.*;
import javax.persistence.Table;
import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.jpa.support.JpaConst;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import lombok.Data;

/**
 * <p>ArticleCategory 实体类</p>
 * <p>Table: t_article_category - 文章分类表</p>
 * @author generator
 * @date 2021-04-08 02:38:11
 */
@ApiModel("ArticleCategory 实体类")
@Data
@Entity
@EntityListeners(AuditingEntityListener.class)
@Table(name = "t_article_category")
@SQLDelete(sql = "update t_article_category set is_deleted = 1 where id = ?")
@Where(clause = JpaConst.WHERE_CLAUSE_NOT_DELETED)
@DynamicInsert(true)
@DynamicUpdate(true)
public class ArticleCategory extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 父级ID
	 */
    @ApiModelProperty("父级ID")
	@Column(name = "pid")
    private Integer pid;

    /**
	 * 文章分类标题
	 */
    @ApiModelProperty("文章分类标题")
	@Column(name = "title")
    private String title;

    /**
	 * 文章分类简介
	 */
    @ApiModelProperty("文章分类简介")
	@Column(name = "intr")
    private String intr;

    /**
	 * 文章分类图片
	 */
    @ApiModelProperty("文章分类图片")
	@Column(name = "image")
    private String image;

    /**
	 * 状态
	 */
    @ApiModelProperty("状态")
	@Column(name = "status")
    private Integer status;

    /**
	 * 排序
	 */
    @ApiModelProperty("排序")
	@Column(name = "sort")
    private Integer sort;

    /**
	 * 1删除0未删除
	 */
    @ApiModelProperty("1删除0未删除")
	@Column(name = "is_deleted")
    @JSONField(serialize=false)
    private Integer isDeleted;

    /**
	 * 添加时间
	 */
    @ApiModelProperty("添加时间")
	@Column(name = "create_time")
    private Date createTime;

    /**
	 * 修改时间
	 */
    @ApiModelProperty("修改时间")
	@Column(name = "update_time")
    @JSONField(serialize=false)
    private Date updateTime;

    /**
	 * 是否隐藏
	 */
    @ApiModelProperty("是否隐藏")
	@Column(name = "hidden")
    private Integer hidden;
}